package ro.flashbite.loggers
{
	import flash.errors.IllegalOperationError;
	
	import ro.flashbite.errors.DontInstanciateError;
	
	/**
	 * These are the level ID's specified for debug purpose
	 * 
	 * v 1.0
	 * 
	 * @author Adrian Barbu
	 */	
	public final class LoggerLevels
	{
		public function LoggerLevels() { throw new DontInstanciateError(); }
		
		/**
		 * use this variable if you want none of the outputs to be send
		 */		
		public static const NO_OUTPUT	:	uint 	= 0;
		/**
		 * Default level; the color will be black
		 */		
		public static const ALL			:	uint 	= int.MAX_VALUE;
		/**
		 * Debug level; the color will be blue 
		 */		
		public static const DEBUG		:	uint 	= 1;
		/**
		 * Error level; the color will be red 
		 */		
		public static const ERROR		:	uint	= 2;
		
		/**
		 * Function to return a String representation of the log level 
		 * 
		 * @param level: (uint) defined in this class consts
		 * @return: (String) representation of a level id
		 */		
		public static function levelToString(level:uint):String
		{
			switch (level) {
				case 1:		return "DEBUG";	break;
				case 2:		return "ERROR";	break;	
				default: 	return "ALL"; 	break;	
			}
		}
		
		/**
		 * Function to return a Color representation of the log level 
		 * 
		 * @param level: (uint) defined in this class consts
		 * @return: (uint) color representation of a level id
		 */	
		public static function levelToColor(level:uint):uint
		{
			switch (level) {
				case 1:		return 0x0000FF;	break;
				case 2:		return 0xFF0000;	break;	
				default: 	return 0x000000; 	break;	
			}
		}
	}
}